{  ACMP.RU
   Statement: http://acmp.ru/?main=task&id_task=11
   Verdict: Accepted
}
uses 
    SysUtils, Math;
     
Const 
    MaxDig=10; 
    Osn=round(1e18);   
    
Type 
    Tlong = Array[0..MaxDig] Of int64;
    
var 
    i,n,k,kk:longint;
    a:array[-400..400] of TLong;

Procedure ReadLong(Var A : Tlong; s:string);
    Var i,ii : Integer;
    Begin
        FillChar(A, SizeOf(A), 0) ;
        s:=s+' ';
        ii:=1;
        While Not(s[ii] In ['0'..'9']) Do inc(ii);
        While s[ii] In ['0'..'9'] Do
        Begin
            For i := A[0] DownTo 1 Do
            Begin
                {"i?ioaneeaaiea" noa?oae oeo?u a ?enea ec A[i]
                a ieaaoo? oeo?o ?enea ec A[i+l]}
                A[i+1] := A[i+1] + (LongInt(A[i]) * 10) Div Osn;
                A[i] := (LongInt(A[i]) * 10) Mod Osn
            End;
            A[1] := A[1] + Ord(s[ii]) - Ord('0');
            {aiaaaeyai ieaaoo? oeo?o e ?eneo ec A[1]}
            If A[A[0]+1] > 0 Then Inc(A[0]);
            {eciaiyai aeeio, ?enei caaaenoaiaaiiuo yeaiaioia ianneaa A}
            inc(ii);
        End
    End;
Procedure WriteLong(Const A : Tlong);
    Var     ls, s : String; i : Integer;
    Begin
        Str(Osn Div 10, ls);
        Write(A[A[0]]); {auaiaei noa?oea oeo?u ?enea}
        For i := A[0] - 1 DownTo 1 Do
        Begin
            Str(A[i], s);
            While Length(s) < Length(ls) Do s := '0' + s;
            {aiiieiyai iacia?aueie ioeyie}
            Write(s)
        End;
        WriteLn
    End;
Procedure SumLongTwo(A, B : Tlong; Var C : Tlong);
    Var i, k : Integer;
    Begin
        FillChar(C, SizeOf (C), 0) ;
        If A[0] > B[0] Then k := A[0] Else k :=B[0];
        For i := 1 To k Do
        Begin     C[i+1] := (C[i] + A[i] + B[i]) Div Osn;
            C[i] := (C[i] + A[i] + B[i]) Mod Osn
        End;
        If C[k+1] = 0 Then C[0] := k Else C[0] := k + 1
    End;

Procedure Sub (Var A : TLong; B : TLong; Const sp : Integer);
    Var i, j: Integer;

procedure swap(var a,b:int64);

var
    t:int64;

begin
t:=a;
a:=b;
b:=t;
end;

procedure rev(var a:tlong);

var
    i,kk:longint;

begin
kk:=a[0] div 2;
for i:=1 to kk do
    swap(a[i],a[a[0]-i+1]);
end;

    Begin
        rev(a);
        rev(b);
        
        For i := 1 To B[0] Do
        Begin Dec(A[i+sp], B[i]);
            j := i;
            while (A[j+sp] < 0) and (j <= A[0]) Do
            Begin
                Inc(A[j+sp], Osn) ;
                Dec(A[j+sp-1]); Inc(j);
            end;
        End;
        i := A[0];
        While (i > 1) And (A[i] = 0) Do Dec(i);
        A[0] := i;
        rev(a);
    End;
    
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(k,n);
fillchar(a,sizeof(a),0);
readlong(a[0],'1');
a[1]:=a[0];
for i:=2 to n do begin
    kk:=min(k,i);
    if (k=kk) and (k<>i) then begin    
        sumlongtwo(a[i],a[i-1],a[i]);
        if k>1 then begin
            sumlongtwo(a[i],a[i-1],a[i]);
            sub(a[i],a[i-k-1],a[i][0]-a[i-k-1][0]); 
        end;
    end else begin
            sumlongtwo(a[i],a[i-1],a[i]);
            sumlongtwo(a[i],a[i-1],a[i]);
    end;
end;                               // 1 2 4 7 13 24 44 81 149 274
writelong(a[n]);
end.
